package com.huaxin.common.Entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Administrator on 2016/12/29.
 */
public class SubDevice extends BaseDTO implements Parcelable {
    String subDeviceCode;
    String subDeviceName;
    int type;
    String checkpointCycle;
    int nowState;
    String brand;//品牌
    String model;//型号
    String power;
    long weight;
    long productDate;
    long purchaseDate;
    long startDate;
    List<String> imgUrl;

    protected SubDevice(Parcel in) {
        subDeviceCode = in.readString();
        subDeviceName = in.readString();
        type = in.readInt();
        checkpointCycle = in.readString();
        nowState = in.readInt();
        brand = in.readString();
        model = in.readString();
        power = in.readString();
        weight = in.readLong();
        productDate = in.readLong();
        purchaseDate = in.readLong();
        startDate = in.readLong();
        imgUrl = in.createStringArrayList();
    }

    public static final Creator<SubDevice> CREATOR = new Creator<SubDevice>() {
        @Override
        public SubDevice createFromParcel(Parcel in) {
            return new SubDevice(in);
        }

        @Override
        public SubDevice[] newArray(int size) {
            return new SubDevice[size];
        }
    };

    public String getSubDeviceCode() {
        return subDeviceCode;
    }

    public String getSubDeviceName() {
        return subDeviceName;
    }

    public int getType() {
        return type;
    }

    public String getCheckPointCycle() {
        return checkpointCycle;
    }

    public int getNowState() {
        return nowState;
    }

    public String getBrand() {
        return brand;
    }

    public String getModel() {
        return model;
    }

    public String getPower() {
        return power;
    }

    public long getWeight() {

        return weight;
    }

    public long getProductDate() {
        return productDate;
    }

    public long getPurchaseDate() {
        return purchaseDate;
    }

    public long getStartDate() {
        return startDate;
    }

    public List<String> getImgUrl() {
        return imgUrl;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(subDeviceCode);
        dest.writeString(subDeviceName);
        dest.writeInt(type);
        dest.writeString(checkpointCycle);
        dest.writeInt(nowState);
        dest.writeString(brand);
        dest.writeString(model);
        dest.writeString(power);
        dest.writeLong(weight);
        dest.writeLong(productDate);
        dest.writeLong(purchaseDate);
        dest.writeLong(startDate);
        dest.writeStringList(imgUrl);
    }
}
